package com.asia5b.a5bmall.same.adapter

import android.widget.ImageView
import com.asia5b.a5bmall.same.R
import com.asia5b.a5bmall.same.databinding.ItemParceladdressAdapterBinding
import com.asia5b.a5mall.middleware.model.member.AddressModel
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder

/**
 * Created by zhangyuncai on 2020/1/8.
 */
class ParcelAddressAdapter(list: ArrayList<AddressModel>) :
        BaseQuickAdapter<AddressModel,BaseDataBindingHolder<ItemParceladdressAdapterBinding>>(R.layout.item_parceladdress_adapter, list) {
    var selectId = 0
    override fun convert(holder: BaseDataBindingHolder<ItemParceladdressAdapterBinding>, item: AddressModel) {
        val binding=holder.dataBinding!!
                binding.model = item
        val iv_addresslist_check = holder.getView<ImageView>(R.id.iv_addresslist_check)
        iv_addresslist_check.isSelected = (selectId == item.addr_id)
    }
}